{% extends 'base.html' %}

{% block content %}
    {% if paper %}
        <div>
            <h3> Authors </h3>
            <ul>
                {% for author in authors %}
                    <li>
                        <div> {{author.name}} </div>
                        <div> {{author.email}} </div>
                    </li>
                {% endfor %}
            </ul>
        </div>
        <div>
            <h3> Versions </h3>
            <ul>
                {% for paper_version in paper_versions %}
                    <a href="{{paper_version.contents.url}}">{{paper_version.time}}</a>
                {% endfor %}
            </ul>
        </div>
        <div>
            <h3> Abstract </h3>
            <pre>{{latest_abstract}}</pre>
        </div>
        <div>
            <h3> Reviews </h3>
            <ul>
                {% for review in reviews %}
                    <li>
                        <div> {{review.reviewer.username}} at {{review.time}} </div>
                        <div> Comment: <pre>{{review.contents}}</pre> </div>
                        <div> Novelty: {{review.score_novelty}} </div>
                        <div> Presentation: {{review.score_presentation}} </div>
                        <div> Technical: {{review.score_technical}} </div>
                        <div> Confidence: {{review.score_confidence}} </div>
                    </li>
                {% endfor %}
            </ul>
        </div>
        <div>
            <h3> Comments </h3>
            <ul>
                {% for comment in comments %}
                    <li>
                        <div> {{comment.user.username}} at {{comment.time}} </div>
                        <div> Comment: <pre>{{comment.contents}}</pre> </div>
                    </li>
                {% endfor %}
            </ul>
        </div>



        <div>
            <a href="/submit_review?id={{paper.id}}">Submit review</a>
        </div>

        <div>
            <a href="/submit_comment?id={{paper.id}}">Submit comment</a>
        </div>
    {% else %}
        Not found. The planets must not be aligned correctly, or perhaps no paper with the given 'id' exists.
    {% endif %}
{% endblock %}
